' Theremino Automation

' Program SPL ORIGINAL - By SPL officina
' (programma scritto nella vecchia versione di Theremino Automation)

Slot GcodeAutomation 30
' --------------------------------------------- inizio ciclo
Wait Button Start   ' attesa pulsante Start
Output Slot 20 1000 ' Start rulliera ingresso
' ---------------------------------------------
'Wait Slot 10 Low    ' attesa sensore 1 
Output Slot 21 1000 ' Start rulliera centrale
' ---------------------------------------
'Wait Slot 11 Low    ' attesa sensore 2
Output Slot 20 0    ' stop rulliera ingresso
Output Slot 21 0    ' stop rulliera centrale
'Wait Seconds 1      ' tempo attesa partenza Gcode 1 TETTO
Start Gcode 1
Wait GcodeEnd
Wait Seconds 1      ' tempo attesa partenza dopo g code 1
' --------------------------------------- ciclo SPL
Output Slot 21 1000 ' Start rulliera centrale avanti veloce
Wait Seconds 7      ' tempo di marcia avanti veloce
Output Slot 21 0    ' stop rulliera centrale
Wait Seconds 1      ' tempo attesa partenza Gcode 2 BAULE 
Start Gcode 2
Wait GcodeEnd       ' maccHina pos.avanti fatto baule dopo Gcode 2
Wait Seconds 1      ' tempo attesa partenza dopo g code 2
Output Slot 26 1000 ' Start rele per marcia indietro
Output Slot 21 1000 ' Start rulliera centrale indietro
Wait Slot 11 Low 
Wait Seconds 6      ' tempo di marcia indietro veloce
Output Slot 21 0    ' stop rulliera centrale
Output Slot 26 0    ' stop rele marcia indietro
Wait Seconds 0.5
Start Gcode 3
Wait GcodeEnd
Wait Seconds 0.5      ' tempo attesa partenza dopo g code 3 COFANO 
Output Slot 21 1000   ' Start rulliera centrale marcia avanti
Wait Slot 11 Low      ' attesa sensore 2
Output Slot 21 0      ' stop rulliera centrale con maccHina in pos. centrale
Wait Seconds 1
'------------------------------------------ESECUZIONE G CODE 4 FIANCO 1
Start Gcode 4
Wait GcodeEnd
Wait Seconds 1
'------------------------------ ciclo salita e rotazione piattello a 180
Output Slot 23 1000    ' Start_Output(4)
Wait Slot 15 Low       ' Wait_Input(6)
Output Slot 23 0       ' Stop_Output(4)
Wait Seconds 0.5
Output Slot 24 1000    ' Start_Output_5
Wait Slot 17 Low       ' Wait_Input(8)
Output Slot 24 0       ' Stop_Output(5)
Wait Seconds 0.5
'----------------------------- effettuata fine rotazione piattello a 180
Output Slot 23 1000    ' Start_Output(4)
Wait Slot 14 Low       ' Wait_Input(5)
Output Slot 23 0       ' Stop_Output(4)
Wait Seconds 0.5
'----------------------------- effettuata fine discesa e maccHina a 180
Start Gcode 5
Wait GcodeEnd
Wait Seconds 0.5
'---------------------------- ciclo gcode 5 fatto FIANCO 2
Output Slot 23 1000    ' Start_Output(4)
Wait Slot 15 Low       ' Wait_Input(6)
Output Slot 23 0       ' Stop_Output(4)
Wait Seconds 0.5
Output Slot 24 1000    ' Start_Output(5)
Wait Slot 16 Low       ' Wait_Input(7)
Output Slot 24 0       ' Stop_Output(5)
Wait Seconds 0.5
'------------------------ effettuato ciclo salita e rotazione piattello in home a 0
Output Slot 23 1000    ' Start_Output(4)
Wait Slot 14 Low       ' Wait_Input(5)
Output Slot 23 0       ' Stop_Output(4)
Wait Seconds 0.5
'-------------------------- effettuato ciclo discesa maccHina a zero pronta a uscire
Output Slot 21 1000    ' Start_Output(2)   ' parte ultima volta rulliera 2
Wait Seconds 2
Output Slot 22 1000    ' Start_Output(3)        ' parte ultima volta rulliera 3
Wait Slot 13 Low       ' Wait_Input(4)          ' fine ciclo con maccHina in uscita
Output Slot 21 0       ' Stop_Output(2)         ' stop rulliera 2
Output Slot 22 0       ' Stop_Output(3)         ' stop rulliera 3 e fine ciclo

